import Schema from "async-validator"
Schema.messages.required = fieldName =>{
	console.log(fieldName)
	return "该项为必填项"
}
Schema.messages.string.range = (filedName,min,max)=>{
	return `字符长度须在${min}~${max}之间`
}
// Schema.messages = {
// 	"default": "Validation error on field %s",
// 	required: "该项为必填项",
// 	"enum": "%s must be one of %s",
// 	whitespace: "%s cannot be empty",
// 	date: {
// 		format: "%s date %s is invalid for format %s",
// 		parse: "%s date could not be parsed, %s is invalid ",
// 		invalid: "%s date %s is invalid"
// 	},
// 	types: {
// 		string: "%s is not a %s",
// 		method: "%s is not a %s (function)",
// 		array: "%s is not an %s",
// 		object: "%s is not an %s",
// 		number: "%s is not a %s",
// 		date: "%s is not a %s",
// 		boolean: "%s is not a %s",
// 		integer: "%s is not an %s",
// 		float: "%s is not a %s",
// 		regexp: "%s is not a valid %s",
// 		email: "%s is not a valid %s",
// 		url: "%s is not a valid %s",
// 		hex: "%s is not a valid %s"
// 	},
// 	string: {
// 		len: "该项必须是 %s 个字符",
// 		min: "该项至少是 %s 个字符",
// 		max: "该项不能超过 %s 个字符",
// 		range: "字符长度须在 %s ~ %s之间"
// 	},
// 	number: {
// 		len: "%s must equal %s",
// 		min: "%s cannot be less than %s",
// 		max: "%s cannot be greater than %s",
// 		range: "%s must be between %s and %s"
// 	},
// 	array: {
// 		len: "%s must be exactly %s in length",
// 		min: "%s cannot be less than %s in length",
// 		max: "%s cannot be greater than %s in length",
// 		range: "%s must be between %s and %s in length"
// 	},
// 	pattern: {
// 		mismatch: "%s value %s does not match pattern %s"
// 	},
// 	clone: function clone() {
// 		var cloned = JSON.parse(JSON.stringify(this))
// 		cloned.clone = this.clone
// 		return cloned
// 	}
// }
console.log(Schema.messages)
